package com.malljelly.study.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.malljelly.study.dao.mapper.OrderMapper;
import com.malljelly.study.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by 骑着蜗牛去旅行 on 2018/9/3.
 */
@Service
public class OrderServiceImpl implements OrderService {


   @Autowired
   private OrderMapper orderMapper;

    @Override
    public JSONObject updateOrderId(Long isPay, String aliPayId, String orderNumber) {
        JSONObject result=new JSONObject();

        int updateOrder = orderMapper.updateOrder(isPay, aliPayId, orderNumber);
        if (updateOrder <= 0) {
            result.put("code",-1);
            result.put("msg", "系统错误");
            return result;
        }
        result.put("code",0);
        return result;
    }
}
